<template>
  <!-- 来源管理 -->
  <SourceIndex v-if="activemenus.value == 'source'" />
  <!-- 分组管理 -->
  <GroupingIndex v-if="activemenus.value == 'grouping'"/>
  <!-- IP池管理 -->
  <ProxyipIndex v-if="activemenus.value == 'proxyip'"/>
  <!-- 登录管理 -->
  <LoginIndex v-if="activemenus.value == 'login'"/>
  <!-- 登录管理 -->
  <AuthorizeIndex v-if="activemenus.value == 'authorize'"/>
</template>

<script setup>
import SourceIndex from './source/Index.vue'
import GroupingIndex from './grouping/Index.vue'
import ProxyipIndex from "./proxyip/Index.vue";
import LoginIndex from "./login/Index.vue";
import AuthorizeIndex from "./authorize/index.vue";

const props = defineProps({
  activemenus: Object,
})

const timetrans = timestamp => {
  // 32位时间戳转为整数
  timestamp = parseInt(timestamp)

  // 时间戳是秒级，需要转为毫秒
  var date = new Date(timestamp * 1000)

  // 获取年份
  var year = date.getFullYear()

  // 获取月份，月份从0开始需要加1
  var month = date.getMonth() + 1
  month = month < 10 ? '0' + month : month

  // 获取日期
  var day = date.getDate()
  day = day < 10 ? '0' + day : day

  // 获取小时
  var hour = date.getHours()
  hour = hour < 10 ? '0' + hour : hour

  // 获取分钟
  var minute = date.getMinutes()
  minute = minute < 10 ? '0' + minute : minute

  // 获取秒钟
  var second = date.getSeconds()
  second = second < 10 ? '0' + second : second

  // 拼接成具体的时间格式
  var datetime = year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second

  return datetime
}
provide('timetrans', timetrans);

</script>

<style lang="scss" scoped>
::v-deep .setting-title {
  font-family: PingFangSC;
  font-size: 20px;
  font-weight: 600;
  font-stretch: normal;
  font-style: normal;
  line-height: 1.4;
  letter-spacing: normal;
  color: #252a30;
}

::v-deep thead .cell {
  font-family: PingFangSC !important;
  font-size: 14px;
  color: #778090;
}
::v-deep tbody .cell {
  font-family: PingFangSC !important;
  font-size: 14px;
  color: #252a30;
}
::v-deep .el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell{
  background-color: #f5f7fa;
}

::v-deep .el-table__inner-wrapper tr:hover{
  background-color: #f5f7fa;
}

// ::v-deep .el-table__inner-wrapper tr th:first-child,
// ::v-deep .el-table__inner-wrapper tr td:first-child {
//   border-radius: 8px 0 0 8px;
// }

// ::v-deep .el-table__inner-wrapper tr th:last-child,
// ::v-deep .el-table__inner-wrapper tr td:last-child {
//   border-radius: 0 8px 8px 0;
// }

::v-deep .csspointer {
  color: var(--pcmain-color);
  cursor: pointer;
  font-family: PingFangSC;
}
</style>